package com.jwds.digital.bios.business.service.service.belt.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jwds.digital.bios.business.core.infrastructure.dto.belt.BeltMotorHistoryDayDTO;
import com.jwds.digital.bios.business.core.infrastructure.entity.belt.BeltMotorHistoryDay;
import com.jwds.digital.bios.business.core.infrastructure.mapper.belt.BeltMotorHistoryDayMapper;
import com.jwds.digital.bios.business.core.infrastructure.vo.belt.BeltMotorHistoryDayVO;
import com.jwds.digital.bios.business.service.service.belt.IBeltMotorHistoryDayService;
import com.jwds.tdc.framework.application.lib.page.PageRequest;
import com.jwds.tdc.framework.application.lib.page.PageResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 线路效能天表实现类
 * @author 席鹏程
 * @date 2024-11-14
 */
@Slf4j
@Service
public class BeltMotorHistoryDayServiceImpl extends ServiceImpl<BeltMotorHistoryDayMapper, BeltMotorHistoryDay> implements IBeltMotorHistoryDayService {

    @Autowired
    private BeltMotorHistoryDayMapper baseMapper;

    @Override
    public PageResponse<BeltMotorHistoryDayVO> page(PageRequest<BeltMotorHistoryDayDTO> request) {
        BeltMotorHistoryDayDTO condition = request.getQueryCondition();
        Page<BeltMotorHistoryDayVO> page = new Page<>(request.getPageIndex(), request.getPageSize());
        IPage<BeltMotorHistoryDayVO> pageData = baseMapper.pageQuery(page, condition);
        return new PageResponse<>((Page<?>)pageData, pageData.getRecords());
    }

    @Override
    public List<BeltMotorHistoryDayVO> list(BeltMotorHistoryDayDTO reqDto) {
        return baseMapper.queryList(reqDto);
    }

}